home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: MegaDisc / MegaDisc 32 (1993-02)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).zip / MegaDisc 32 (1993-02)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).adf / hyperbook / HyperBook_Menu < prev    next >
Text File  |  1993-02-11  |  11KB  |  216 lines

  1.  
  2.                                                        
  3.                   Menu Systems and Flexible Selectors  
  4.                                                        
  5.  
  6.                             by John Collett
  7.  
  8.  
  9.     ]] 32 [[ ]] 32 [[ ]] 32 [[ ]] 32 [[ ]] 32 [[ ]] 32 [[ ]] 32 [[ ]] 32 [[
  10.  
  11.  
  12.     Along came MD31 - a wide-ranging and interesting collection, including
  13.     the useful, the amusing, the challenging, the sometimes downright
  14.     baffling, and all presented at that impeccably high standard we have
  15.     come to expect from the editor's desk.  (Even the Editorial was
  16.     interesting - MD Extras is a great idea.)
  17.  
  18.     Some topics keep coming back, and we have long had a rich and sometimes
  19.     bewildering choice of menu systems.  Just when I thought that surely
  20.     nobody would be showing us any more ways of obtaining user-designed
  21.     menus, we were offered at least two further bites at that particular
  22.     cherry.
  23.  
  24.     1   MasterMenu, 'a non-fancy, easy-to-use menu system capable
  25.         of handling 32 menu entries', reviewed by John Knight, who
  26.         provided an elegant sample screen, and an enthusiastic
  27.         description of its strengths.
  28.  
  29.     2   P-Index,"a flexible selector program", another impressive
  30.         contribution from Chas A. Wyndham, the author of the P-Suite
  31.         series of utilities, this time "showing us how we can arrange a
  32.         menu in terms of labels or icons to suit our personal taste."
  33.  
  34.  
  35.     These presentations confronted me just as I was suffering from a
  36.     particularly nasty attack of exaggerated self-satisfaction because of
  37.     the way in which my own recent menu-designing had provided what I
  38.     thought was the last word in elegance, power, flexibility, and
  39.     aesthetic appeal, and I had got into a settled routine in using it.
  40.     Modesty being one of my dominant personality traits (I'm glad you'd
  41.     noticed), I wasn't going to boast about it.  But the presence of the
  42.     above-mentioned two items on MD31 indicated that the subject of
  43.     menu-design may still be open for discussion via MegaDisc, and made me
  44.     think that readers might tolerate at least one more contribution on
  45.     that topic.  So here it is.
  46.  
  47.     I'm still using HyperBook as my general work environment, and have as
  48.     yet no inclination to change.  I boot into 'defaulthyperbook', in which
  49.     I have built a launch pad for everything I wish to do, and so of course
  50.     it contains a menu, a 'flexible selector'.  Menus which look like those
  51.     described and demonstrated by John Knight and Chas Wyndham can be
  52.     produced in HyperBook, though my personal preference at the moment is
  53.     the use of a HyperBook 'list' - by definition, the most appropriate and
  54.     efficient tool for a menu, if not the most interesting visually.
  55.  
  56.     For new readers and those who may have missed earlier articles on
  57.     HyperBook, here is a very brief and obviously incomplete description of
  58.     some of its main features:
  59.  
  60.     Five types of 'object' can be placed on a HyperBook page:
  61.  
  62.      1   Notes
  63.     Text in boxes, with any combinations of colour, style, and fonts. A
  64.     box can have different colour and/or shadow settings, or it can be
  65.     invisible.
  66.  
  67.      2   Buttons
  68.     Similar to 'Notes' in almost every respect, but intended to offer
  69.     clickable buttons containing short text such as numbers or single
  70.     letters, or even no text at all.
  71.  
  72.      3   Drawings
  73.     A built-in drawing editor can be used to produce drawings including
  74.     lines, rectangles, circles, polygons, etc., with various options such
  75.     as colour and fill.
  76.  
  77.      4   Pictures
  78.     Any rectangle can be selected from an IFF screen obtained from any
  79.     other source, and placed in brush fashion on a page.
  80.  
  81.      5   Lists
  82.     Similar to the scrolling portion of practically any file requester, but
  83.     the items in the list can be anything you like.
  84.  
  85.     Any of these 'objects' can be placed anywhere on a page, stretched to
  86.     any size, copied, hidden, deleted - the possibilities are unlimited.
  87.     But what the objects look like and where they are is only the beginning
  88.     of the story.  Any of them (in the case of a list, any of its items)
  89.     can also be made active, and preset to carry out any of the following
  90.     'actions':
  91.  
  92.                   No action              Go to page    
  93.                   Show picture           Show/hide     
  94.                   Display text           DOS command   
  95.                   ARexx command          ARexx macro   
  96.  
  97.     They all have their role to play, but the real power of HyperBook can
  98.     be tapped by using the ARexx items in the bottom line.  Being in
  99.     HyperBook, we also have access to the 137 functions of HML, the
  100.     HyperBook Macro Language which I have dealt with in some detail
  101.     elsewhere.
  102.  
  103.     Any text, any button, any drawing, any picture, or any item in a list
  104.     can be set to perform virtually any action.  Arranging a set of any of
  105.     them to behave like a menu is an easy route to whatever you expect
  106.     from a menu : access to utilities; writing, editing, or running
  107.     programs; using DOS commands; editing or reading text; playing music;
  108.     and so on.
  109.  
  110.     The action may be one of those which can be explicitly set from the
  111.     range of options shown above.  I have, for example, one entry which
  112.     reads 'Jobs' (nothing to do with the Directory Utility of that name)
  113.     which leads by means of a 'Go to page' action to a page on which I have
  114.     three lists of different types of personal reminders.  If I have made a
  115.     start on the job in question, then a click on its item leads me to its
  116.     workplace, whatever it is, and I can proceed with it.  (The little
  117.     reminder notes I have tucked away in this fashion seem to behave like
  118.     rabbits!)
  119.  
  120.  
  121.       An ARexx command example  
  122.  
  123.     As an example of an entry which uses an ARexx command, I have a 'New
  124.     Shell' entry.  You might reasonably expect that requirement to be
  125.     covered by the 'DOS command' option, but when I need to use it, I want
  126.     it to put the current HyperBook screen to the back before opening the
  127.     new Shell.  So I use an ARexx command containing two clauses:
  128.  
  129.       call HyperBookToBack() ; ..
  130.         .. address command 'NewShell CON:10/20/500/180/Shell/CLOSE'
  131.  
  132.     When I need a Shell window, I click on the menu item, the HB screen
  133.     goes to the back, and a Shell window of the given dimensions appears.
  134.     I must admit I don't use this item in my menu very frequently, because
  135.     as soon as I find I need to use it for the same purpose more than once
  136.     or twice, I add an appropriate new item to my menu.
  137.  
  138.     As entered, ARexx commands can contain several clauses, which means
  139.     that they can hold what are in fact short macros, as long as the total
  140.     length does not exceed 255 characters. Very handy.
  141.  
  142.  
  143.        An ARexx macro example  
  144.  
  145.     For bigger jobs, an ARexx macro proper is required.  One which I use
  146.     every day is called 'QED_or_FV', which gets me into the QED text editor
  147.     OR into FullView, depending on which item I click on in the list.
  148.  
  149.     It carries out the following steps:
  150.  
  151.         ° Check that 'rexxsupport.library' is active.
  152.         ° Read text in clicked item, to determine whether QED or
  153.           FullView is required.
  154.         ° For either, if it has not yet been copied into Ram:, copy it.
  155.         ° Call FileRequest() to get the name of the file required.
  156.         ° Call HyperbookToBack()
  157.         ° For QED,       set stack to 10000
  158.                          com = 'RUN >NIL: QED ' ||filename
  159.         ° For Fullview,  com = 'FullView ' ||filename
  160.         ° address command com
  161.  
  162.     When I am working regularly on a particular text, then I activate a
  163.     variation on the 'QED_or_FV' macro which automatically loads a file of
  164.     a given name.
  165.  
  166.     Any other HyperBook file can be loaded using the ARexx command 'call
  167.     LoadHyperBook(filename)', and as long as the last item of that HB
  168.     file is 'call LoadHyperBook("defaulthyperbook")', then it returns to
  169.     the menu.  For example, I have recently been exploring 'Scan&Save', and
  170.     storing some of its products in a separate HB file.  When I want to
  171.     see them, add to them, or whatever, then a click on my menu loads that
  172.     file, and the default file containing my menu is reloaded when I
  173.     have finished.
  174.  
  175.     If a completely separate program is run, then it is not always possible
  176.     to persuade it to put the menu screen back to the front when it has
  177.     finished. In such cases, a keyclick on the back/front gadget is all
  178.     that it takes to get back - though I think that an exploration of
  179.     running brief DOS scripts may solve this.
  180.  
  181.     As I said above, my menu is in a list form, and looks like the
  182.     scrollable portion of a file requester.  It can be made any size, any
  183.     colour, with borders, shadows, etc. of my choice.  Different colours
  184.     can be invoked if required for different types of item in the list.
  185.  
  186.     Or I could quite easily go in a completely different direction,
  187.     without in any way diminishing the ease with which 'actions' can be
  188.     invoked.  Each menu item could be a 'Note', designed to look like a
  189.     drawer (or anything else), with any kind of embossing, recessing,
  190.     shadowing, etc. that looks effective.  Or they could be buttons, like
  191.     the dramatic little red lights in the 'MenuMaster' sample in MD31 - and
  192.     a nice touch would be to have the 'light' of a button change colour
  193.     when you click it. (A way to do this in HyperBook would be to have two
  194.     buttons in the same place, and make one of their jobs to switch
  195.     themselves off and their partner on, using the HML SetVisibility
  196.     function.)
  197.  
  198.     P-Index in MD31 showed how icons can be clicked on to invoke menu
  199.     selections.  The same effect is possible in HB, using sets of drawings
  200.     or pictures.
  201.  
  202.     I did think of preparing a screen with samples of some of the menu
  203.     types I have been attempting to describe, but decided against it.  In
  204.     the end, I thought it best to let you use your imagination.  Think
  205.     about the sort of menu you would really like to have available as your
  206.     day-to-day 'flexible selector'.  The chances are, it could be done in
  207.     HyperBook.
  208.  
  209.  
  210.     Hamilton, NZ; December, 1992 
  211.  
  212.  
  213.     ]] 32 [[ ]] 32 [[ ]] 32 [[ ]] 32 [[ ]] 32 [[ ]] 32 [[ ]] 32 [[ ]] 32 [[
  214.  
  215.  
  216.